package net.esj.basic.dao.hibernate.impl;

import java.util.Collection;

import net.esj.basic.core.engine.support.validator.exception.MelonValidateException;
import net.esj.basic.exception.MelonException;
import net.esj.basic.pojo.UpdateType;

/**
 * 强制不能使用任何默认的持久化，必须要用户自己定义
 * @author Administrator
 *
 */
public class ForbiddenDefaultPersistentHibernateDaoImpl extends
		HibernateDaoImpl {

	@Override
	public synchronized void delete(Object entity) {
		throw new MelonException("当前类不能使用该方法");
	}

	protected synchronized void deleteInProtected(Object entity){
		super.delete(entity);
	}
	
	@Override
	public void deleteAll(Collection c) {
		throw new MelonException("当前类不能使用该方法");
	}
	
	protected void deleteAllInProtected(Collection c){
		super.deleteAll(c);
	}

	@Override
	public void deleteByHql(String hql) {
		throw new MelonException("当前类不能使用该方法");
	}
	
	protected void deleteByHqlInProtected(String hql){
		super.deleteByHql(hql);
	}

	@Override
	public void save(Object entity) throws MelonValidateException {
		throw new MelonException("当前类不能使用该方法");
	}
	
	protected void saveInProtected(Object entity) throws MelonValidateException {
		super.save(entity);
	}

	@Override
	public void saveOrUpdate(Object entity) throws MelonValidateException {
		throw new MelonException("当前类不能使用该方法");
	}
	
	protected void saveOrUpdateInProtected(Object entity) throws MelonValidateException {
		super.saveOrUpdate(entity);
	}

	@Override
	public void update(Object entity, UpdateType type) {
		throw new MelonException("当前类不能使用该方法");
	}
	
	protected void updateInProtected(Object entity, UpdateType type) {
		super.update(entity,type);
	}

	@Override
	public void update(Object entity) throws MelonValidateException {
		throw new MelonException("当前类不能使用该方法");
	}
	
	protected void updateInProtected(Object entity) throws MelonValidateException {
		super.update(entity);
	}

	
}
